package de.steric.battlemon.Battlemon_Monster.Skills;

import de.steric.battlemon.Battlemon_Monster.BattlemonMonster;

public class Attack extends Skill {

	int baseDamage;
	float scale;

	public Attack(BattlemonMonster self) {
		super(self);

	}

	@Override
	public void execute(BattlemonMonster enemy) {
		float typeMult = this.caster.type.checkMultiplicator(enemy.type);
		float resultDmg = (baseDamage + scale * this.caster.fight.skillAttack)
				* typeMult;
		float blockedDmg = 0.9f * (resultDmg - enemy.fight.skillDefense);
		if (blockedDmg < 0) {
			blockedDmg = 0;
		}
		resultDmg = 0.1f * resultDmg + blockedDmg;
		
		enemy.hit((int)resultDmg);
	}
}
